import { Tabs } from "antd-mobile";
import useFetchChannel from "./useTabs";
import HomeList from "./HomeList";

const List = () => {
  const channelList = useFetchChannel();
  return (
    <div className="tabContainer">
      <Tabs defaultActiveKey='0'>
        {channelList.map((item) => (
          <Tabs.Tab title={item.name} key={item.id}>
            <div className="listContainer">
              {/* HomeList列表 */}
              <HomeList channelId={"" + item.id} />
            </div>
          </Tabs.Tab>
        ))}
      </Tabs>
    </div>
  );
};

export default List;
